find the length of the string without using inbuilt method